package cn.zlp.hrm.controller;

import cn.zlp.hrm.service.ISmsVerifyCodeService;
import cn.zlp.hrm.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @program: hrm-parent
 * @author: Mr.Zhang
 * @create: 2022-01-13 09:43
 **/
@RestController
@RequestMapping("/smsVerifyCode")
public class SmsVerifyCodeController {

    @Autowired
    private ISmsVerifyCodeService smsVerifyCodeService;

    /**
     * 发送短信验证码
     * @param params
     * @return
     */
    @PostMapping("/sendVerifyCode")
    public AjaxResult sendSmsVerifyCode(@RequestBody Map<String,String> params){
        return smsVerifyCodeService.sendSmsVerifyCode(params);
    }

    /**
     * 短信验证码校验
     * @param params
     * @return
     */
    @PostMapping("/verify")
    public AjaxResult verifySmsCode(@RequestBody Map<String,String> params) {
        return smsVerifyCodeService.verifySmsCode(params);
    }

}
